package cn.shyouchi.wuguanjia.android.ui.meetting;

import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import cn.shyouchi.wuguanjia.android.R;
import cn.shyouchi.wuguanjia.android.base.BaseActivity;
import cn.shyouchi.wuguanjia.android.ui.meetting.apply.ApplyMeetActivity;
import cn.shyouchi.wuguanjia.android.ui.meetting.feedback.FeedbackMeetActivity;
import cn.shyouchi.wuguanjia.android.ui.meetting.launch.LaunchMeetActivity;
import cn.shyouchi.wuguanjia.android.ui.meetting.plan.PlanMeetActivity;
import cn.shyouchi.wuguanjia.android.utils.DisplayUtil;
import cn.shyouchi.wuguanjia.android.widget.SpacesItemDecoration;
import cn.shyouchi.wuguanjia.android.widget.TopBar;

public class MeettingMainActivity extends BaseActivity {

    @BindView(R.id.topBar)
    TopBar mTopBar;
    @BindView(R.id.rv_meet_module)
    RecyclerView mRvMeetModule;

    List<MeetModule> mEntities = new ArrayList<>();

    MeetModuleAdapter mMeetModuleAdapter;

    @Override
    public int initContentView() {
        return R.layout.activity_meetting_main;
    }

    @Override
    public void initInjector() {

    }

    @Override
    public void initUiAndListener() {
        ButterKnife.bind(this);
        mTopBar.setTitle(getTitle().toString());
        mTopBar.setLeftIcon(R.mipmap.ic_back);
        setSupportActionBar(mTopBar.getToolbar());

        initModule();
        mMeetModuleAdapter = new MeetModuleAdapter(mEntities);


        mRvMeetModule.setAdapter(mMeetModuleAdapter);

        mRvMeetModule.setLayoutManager(new GridLayoutManager(mContext, 4));

        mRvMeetModule.addItemDecoration(new SpacesItemDecoration(DisplayUtil.dip2px(mContext, 1)));




    }


    private void initModule() {


        mEntities.add(new MeetModule(LaunchMeetActivity.class, R.mipmap.ic_meet_module_launch_meet, "发起会议"));
        mEntities.add(new MeetModule(ApplyMeetActivity.class, R.mipmap.ic_meet_module_apply_meet, "会议申请"));
        mEntities.add(new MeetModule(PlanMeetActivity.class, R.mipmap.ic_meet_module_plan_meet, "会议安排"));
        mEntities.add(new MeetModule(FeedbackMeetActivity.class, R.mipmap.ic_meet_module_feedback_meet, "申请反馈"));


    }

    @Override
    protected boolean isApplyStatusBarTranslucency() {
        return false;
    }

    @Override
    protected boolean isApplyStatusBarColor() {
        return true;
    }

}
